package service.manager.impl;

import dao.manager.ReturnTableDao;
import dao.manager.impl.ReturnTableDaoImpl;
import entity.Books;
import entity.Borrow_books;
import entity.Pages;
import service.manager.ReturnService;
import service.manager.ReturnTableService;

import java.util.List;

/**
 * ReturnTableServiceImpl
 *
 * @author ChenYanMei
 * @version 2023/9/4
 */
public class ReturnTableServiceImpl implements ReturnTableService {
    private ReturnTableDao dao = new ReturnTableDaoImpl();

    /**
     * 查询还书书籍信息
     *
     * @param condition
     * @param conditionValue
     * @return
     */
    @Override
    public List<Borrow_books> getList(String condition, String conditionValue, Pages<Borrow_books> pages) {
        int pageSize = pages.getPageSize();
        int pageIndex = (pages.getPageCountNo() - 1) * pageSize;
        return dao.getList(condition, conditionValue, pageIndex, pageSize);
    }

    /**
     * 查询总数
     *
     * @param condition
     * @param conditionValue
     * @return
     */
    @Override
    public int pageCount(String condition, String conditionValue) {
        return dao.pageCount(condition, conditionValue);
    }
}
